<template>
  <view>
    <button class="" @click="startPullDownRefresh"> 开始刷新 </button>
  </view>
</template>

<script>
export default {
  onShow: function (options) {
    // 加定时器，解决第二次进入页面不执行问题
    setTimeout(() => {
      uni.startPullDownRefresh();
    }, 100);
  },
  onPullDownRefresh() {
    console.log("refresh");
    setTimeout(function () {
      uni.stopPullDownRefresh();
    }, 1000);
  },
  methods: {
    startPullDownRefresh() {
      uni.startPullDownRefresh();
    },
  },
};
</script>

<style>

</style>
